import os,sys
import pytest
root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root_path)
from Tools.logger import logger
from Tools.mail import mail
if __name__ == '__main__':
    # 日志
    logger()
    """ allure """
    pytest.main([r'C:\Users\张震海\Desktop\wms\Case\Case.py', '-s', '--clean-alluredir', '--alluredir=./report'])
    os.system('allure generate ./report o ./html --clean')
    """ html """
    pytest.main([
        r'C:\Users\张震海\Desktop\wms\Case\Case.py',
        '--html=report.html',
        '--self-contained-html'
    ])
    # 发邮件
    mail([r'C:\Users\张震海\Desktop\wms\report.html'
             ,r'C:\Users\张震海\Desktop\wms\allure-report\index.html'
             ,r'C:\Users\张震海\Desktop\wms\log.txt'])